//app.js

App({
  onLaunch: function() {
    // 展示本地存储能力
    /*wx.setStorage({
       key: 'postList',
       data: dataObj.postList,
       success: function(res) {
         //sucess
       },
       fail: function(res) {
         //fail
       },
       complete: function(res) {
        // complete
       },
     })*/
    var storageData=wx.getStorageSync('postList');
    if (!storageData) {
      //如果postList缓存不存在
      var dataObj = require("data/data.js")
      wx.clearStorageSync();
      wx.setStorageSync('postList', dataObj.postList);
    }
  }
})